bitkeeper revision 1.173 (3e9d845cg2MJfwRaBzAjIko6HkW-Dw)
authorsmh22@boulderdash.cl.cam.ac.uk <smh22@boulderdash.cl.cam.ac.uk>
Wed, 16 Apr 2003 16:27:08 +0000 (16:27 +0000)
committersmh22@boulderdash.cl.cam.ac.uk <smh22@boulderdash.cl.cam.ac.uk>
Wed, 16 Apr 2003 16:27:08 +0000 (16:27 +0000)
ide-cd.c:
  verbose errors
ide.c:
  robustify

xen/drivers/ide/ide-cd.c
xen/drivers/ide/ide.c

index c851f0485b8e42d7f0a992e647178181b477be58..26def238232fdf13c22253f8d0a0376fa3a823ea 100644 (file)
@@ -623,6 +623,8 @@ static int cdrom_decode_status (ide_startstop_t *startstop, ide_drive_t *drive,
                   command request to the request sense request. */
 
                if ((stat & ERR_STAT) != 0) {
+                       // XXX SMH: if we get here we should retry ... hmmm
+                       printk("ide-cd: error (stat = 0x%x): will retry\n", stat); 
                        wait = rq->waiting;
                        rq->waiting = NULL;
                }
index 86cf7bca66cab5d396b09bee5bb1c65b71640a15..89db06eb8df0446a13e31f7446b0de8cdace45e3 100644 (file)
@@ -2060,14 +2060,22 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio
 
     /* XXX SMH: spin waiting for response */
     if (action == ide_wait) { 
-       while(*(int *)rq->waiting) {
-           udelay(500); 
-           usecs += 500; 
-           if(usecs > 1000000) { 
-               printk("ide_do_drive_cmd [ide_wait]: giving up after 1s\n"); 
-               *(int *)rq->waiting = 0; 
-           }
+
+       /* if we get an error, ide-cd.c requeues (and kills our 'waitq') */
+       if((rq->waiting != NULL) && *(int *)(rq->waiting)) {
+           do { 
+               udelay(500); 
+               usecs += 500; 
+               if(usecs > 1000000) { 
+                   printk("ide_do_drive_cmd [ide_wait]: giving "
+                          "up after 1s\n"); 
+                   *(int *)rq->waiting = 0; 
+               }
+           } while((rq->waiting != NULL) && *(int *)(rq->waiting)); 
        }
+
+       if(rq->waiting == NULL)
+           return 1; 
     }
 
     return 0;